import Vue from 'vue'

/**
 * 用户操作服务
 */
export default {


  /**
   * 获取医生列表
   * @param {*} params userID
   * @param {*} [config={}]
   */
  async getDoctorInfolList(params, config = {}) {
    config.params = params;
    let result = await Vue.http.get('/DoctorInfo/GetAppointmentDoctorInfolList', config);
    return result;
  },

  /**
   * 获取医生信息byId
   * @param {*} params userID
   * @param {*} [config={}]
   */
  async getDoctorByID(params, config = {}) {
    config.params = params;
    let result = await Vue.http.get('/DoctorInfo/GetDoctorByID', config);
    return result;
  },

  /**
   * 获取医院列表byDoctorId
   * @param {*} params userID
   * @param {*} [config={}]
   */
  async getHospitalListByDoctor(params, config = {}) {
    config.params = params;
    let result = await Vue.http.get('/Hospital/GetHospitalListByDoctor', config);
    return result;
  },

  /**
   * 根据医师编号和医院编号获取30内的预约设置列表
   * @param {*} params userID
   * @param {*} [config={}]
   */
  async getAppointmentListByDoctorAndHospital(params, config = {}) {
    config.params = params;
    let result = await Vue.http.get('/Appointment/GetAppointmentListByDoctorAndHospital', config);
    return result;
  },

  /**
   * 获取医生可预约项目bydoctorId, hospitalId
   * @param {*} params userID
   * @param {*} [config={}]
   */
  async getAppointmentItemByDoctorID(params, config = {}) {
    config.params = params;
    let result = await Vue.http.get('/DoctorAppointmentItem/GetAppointmentItemByDoctorID', config);
    return result;
  },

  /**
   * 预约下单
   * @param {*} params 请求实体
   * @param {*} [config={}]
   */

  async createAppointment(params, config = {}) {
    let result = await Vue.http.post('/AppointmentRecord/CreateAppointment', params, config)
    return result
  },


  /**
   * 删除用户地址信息byId
   * @param {*} params userID
   * @param {*} [config={}]
   */
  async deleteAddressByID(params, config = {}) {
    config.params = params;

    let result = await Vue.http.delete('/UserAddress/DeleteAddressByID', config);
    return result;
  },
}
